package com.jyx.cloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author jyx
 * @version 1.0
 * @email jiangyongxing@myzczk.com
 * @company www.myzczk.com
 * @create-time 2020/5/28 10:36
 */

@Configuration
public class ApplicationContextConfig {


    @Bean
    @LoadBalanced // 使用loadBalanced注解，赋予RestTemplate负载均衡的能力
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
